﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Net;
using System.Data;
using System.Data.SqlClient;

public partial class Property_Info_Pictures : System.Web.UI.Page
{
    string parcel_id = "";

    protected void Page_Load(object sender, EventArgs e)
    {
        parcel_id = Master.ParcelID;
        getSketch();
    }

    private void getSketch()
    {
        try
        {
            WebClient client = new WebClient();

            string start = "<iframe src='http://fcgis1.metacama.com/scripts/gis_show_sketch.pl?pid=";
            string end = "&view=1' width='700px' height='800px'></iframe>";

            //The initial value is just for an example - we will need to get the parcel ID from the database and store it in this string.
            string parcelID = parcel_id;
            string pid = parcelID.Remove(9, 2);
            string p2 = pid.Insert(3, "-");

            string final = string.Concat(start, p2, end);
            Sketch.Text = final;
            Sketch.Visible = true;
        }
        catch
        {
            NoSketch.Visible = true;
        }
    }  
}
